/*
 * @Author: Seon.Hu SeonHu@126.com
 * @Date: 2023-06-16 15:13:22
 * @LastEditors: Seon.Hu SeonHu@126.com
 * @LastEditTime: 2023-11-20 11:13:03
 * @FilePath: \bg-vben\src\components\AdTable\src\hooks\useAdColumns.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import type { PaginationProps } from '@/components/Table/src/types/pagination';
import type { ComputedRef } from 'vue';
import type { AdTableProps } from '../types/adTable';

import { useColumns } from '@/components/Table/src/hooks/useColumns';

export function useAdColumns(
  propsRef: ComputedRef<AdTableProps>,
  getPaginationRef: ComputedRef<boolean | PaginationProps>,
) {
  const {
    getColumnsRef,
    getCacheColumns,
    getColumns,
    setColumns,
    setColumnWidth,
    getViewColumns,
    setCacheColumnsByField,
    setCacheColumns,
  } = useColumns(propsRef, getPaginationRef);

  return {
    getColumnsRef,
    getCacheColumns,
    getColumns,
    setColumns,
    setColumnWidth,
    getViewColumns,
    setCacheColumnsByField,
    setCacheColumns,
  };
}

// format cell
export { formatCell } from '@/components/Table/src/hooks/useColumns';
